home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 May / pcwk_05_99B.iso / Demo Software / Painter Classic / data1.cab / Common / PClassic.rsr / STR#_15.txt < prev    next >
Encoding:
Text File  |  1998-03-26  |  6.0 KB  |  307 lines

  1. red = x;
  2.  
  3. In this example the red component of the image is replaced with a ramp going from 0 at left to 1 at right. Note that this has no effect on the green and blue components.
  4.  
  5. green = 0.5;
  6.  
  7. In this example the green component of the image is replaced with a flat value of 50% green. Note that this has no effect on the red and blue components.
  8.  
  9. blue = noise;
  10.  
  11. In this example the blue component of the image is replaced noise ranging between 0 (no blue) through 1 (100% blue). Note that this has no effect on the red and green components.
  12.  
  13. mask = blue * (1 - green);
  14.  
  15. In this example, the blue component of the image is multipled by the inverse of the green parameter and stores into the mask.
  16.  
  17. red = 1; green = 0; blue = 0; hue = x;
  18.  
  19. In this example, the color is set up to pure red in the first three statements. The last statement varies hue across the image horizontally, creating a spectrum.
  20.  
  21. saturation = 0;
  22.  
  23. Running this example on a color photograph will convert it to grayscale.
  24.  
  25. value = 1 - value;
  26.  
  27. Running this example on a color photograph will create a negative look where the hue is preserved.
  28.  
  29. cyan += 0.1;
  30.  
  31. In this example, ten percent is added to the cyan plate.
  32.  
  33. magenta -= 0.2;
  34.  
  35. In this example, twenty percent is subtracted from the magenta plate.
  36.  
  37. yellow = sqrt(yellow);
  38.  
  39. In this example, the yellow plate is increased considerably.
  40.  
  41. black = 0;
  42.  
  43. In this example, the black plate is dropped.
  44.  
  45. c_red = lerp(red, c_red, c_mask);
  46.  
  47. In this example, just the red part of the floater is dropped.
  48.  
  49. c_red *= red; c_green *= green; c_blue *= blue;
  50.  
  51. In this example, the floater is composited using multiply.
  52.  
  53. c_red -= red; c_green -= green; c_blue -= blue;
  54.  
  55. In this example, the floater is subtracted from the image beneath it.
  56.  
  57. c_mask = min(c_mask, mask);
  58.  
  59. Here, the mask of a floater is included in the image mask beneath it. Note: 0 mask means "inside".
  60.  
  61. c_hue = hue;
  62.  
  63. Here the hue of the floater is stored into the hue of the image beneath it.
  64.  
  65. c_saturation = value;
  66.  
  67. Here the value (brightness) of the floater is stored into the saturation component of the image beneath it.
  68.  
  69. c_value *= value;
  70.  
  71. Here the value component of the floater is multiplied into the value (brightness) of the image behind it.
  72.  
  73. red = c_cyan; green = c_magenta; blue = c_yellow; mask = c_black;
  74.  
  75. When you select all and option-click to float a whole copy of an image, this command lets you separate an image into process color.
  76.  
  77. c_magenta = 0;
  78.  
  79. When operating on a floater, this sets the magenta component of the image behind the selection to zero.
  80.  
  81. mask = 0.5 * max(c_cyan, max(c_magenta, c_yellow));
  82.  
  83. This command computes a 50% GCR black channel for the background image into the floating mask.
  84.  
  85. c_black = 0;
  86.  
  87. This drops away the black plate for the background image behind the floater.
  88.  
  89. red = cc_red; green = cc_green; blue = cc_blue;
  90.  
  91. This example fills the selection with the current color.
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121. red = 1;
  122.  
  123. assigns the value 1 into the red component of the image. If the value of the right hand side expression of the assignment is outside the range 0 through 1, it is clipped onto range before storing.
  124.  
  125. blue = red + green;
  126.  
  127. adds the red and green components of the image and stores the result into the blue component of the image.
  128.  
  129. blue = hue - value;
  130.  
  131. subtracts the value component from the hue component of the image and stores the result into the blue component of the image.
  132.  
  133. red = x * y;
  134.  
  135. multiplies the x and y location fractions of the pixel position within the image and stores the result in the red component of the image.
  136.  
  137. red = red / 2;
  138.  
  139. divides red by 2 and stores the result in the red component of the image
  140.  
  141. blue += green;
  142.  
  143. adds the green component of the image into the blue component of the image.
  144.  
  145. red -= noise;
  146.  
  147. subtracts noise from the red component of the image.
  148.  
  149. blue *= green;
  150.  
  151. multiplies the green component of the image into the blue component of the image.
  152.  
  153. red /= green;
  154.  
  155. divides the green component of the image into the red component of the image.
  156.  
  157. red = 1; green = 0;
  158.  
  159. In this example, the statements are run sequentially. First the red component of the image is set to 1 (full red) and then the green component of the image is set to 0 (no green).
  160.  
  161. hue = lerp(x, y, 0.5);
  162.  
  163. In this example, the pixel x and y positions are parameters to the lerp function. Note the use of parentheses to enclose the parameters.
  164.  
  165. red = (green + blue) / 2;
  166.  
  167. In this example, the green component is added to the blue component of the image before being divided by two and then stored into the red component of the image.
  168.  
  169. value = usin(x*2);
  170.  
  171. In this example the parentheses are used to surround the single parameter to the usin function.
  172.  
  173. value = x;
  174.  
  175. When running this example in a white image, a left-to-right ramp from black to white is created.
  176.  
  177. hue = y;
  178.  
  179. When running this example in a photograph, a spectrum of colors runs vertically through the image.
  180.  
  181. value += noise*0.2 - 0.1;
  182.  
  183. In this example 20 percent noise is added to the lightness of the image, creating a stippled effect. This is hue-protected noise.
  184.  
  185. value = xnoise;
  186.  
  187. This creates vertical random stripes in the image which vary in intensity.
  188.  
  189. value = step(value + ynoise, 1);
  190.  
  191. This creates horizontal random stripes and thresholds the image, rendering it in a sketchy style.
  192.  
  193. value = min(0.1, value);
  194.  
  195. This command limits the minimum luminance of an image to 0.1.
  196.  
  197. mask = max(red, max(green, blue));
  198.  
  199. This command computes the brightest of the red, green, and blue channels (for each pixel) and stores it into the mask.
  200.  
  201. red = pow(red, 0.7); green = pow(green, 0.7); blue = pow(blue, 0.7);
  202.  
  203. This command lightens the image using gamma correction.
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213. value = lerp(usin(x), usin(y), 0.5);
  214.  
  215. This command creates a simple halftone cell.
  216.  
  217.  
  218.  
  219. value = sqrt((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5));
  220.  
  221. This command creates a circular gradation with black in the center.
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239. value = 0;
  240.  
  241. This example sets the image to black.
  242.  
  243. value = 1;
  244.  
  245. This example clears the selection to white.
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303. value = umod(value*4);
  304.  
  305. in this example, the image is turned into 4 bands from black to white. This can be useful in creating wood patterns.
  306.  
  307.